package gui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.swtdesigner.SWTResourceManager;
public class GameHistory {

	private StyledText styledText;
	protected Shell shell;
	private String plGames;
	
	public GameHistory(String plGames){
		this.plGames=plGames;
	}
	/**
	 * Open the window
	 */
	public void open() {
		final Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
	}

	/**
	 * Create contents of the window
	 */
	protected void createContents() {
		shell = new Shell(SWT.TITLE | SWT.BORDER | SWT.CLOSE);
		shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
		shell.setLayout(new FillLayout());
		shell.setSize(415, 536);
		shell.setText("Game History");

		final Composite composite = new Composite(shell, SWT.NONE);
		composite.setBackgroundMode(SWT.INHERIT_DEFAULT);
		composite.setBackgroundImage(SWTResourceManager.getImage(GameHistory.class, "/resources/images/mission.png"));

		styledText = new StyledText(composite, SWT.V_SCROLL | SWT.READ_ONLY);
		styledText.setBackgroundMode(SWT.INHERIT_FORCE);
		styledText.setBounds(33, 80, 336, 346);
		styledText.setText(plGames);
	}

}
